package com.example.ibsp_demo.pojo.entity.message;

import com.fasterxml.jackson.annotation.JsonProperty;

import java.time.LocalDateTime;

/**
 * 点赞消息实体类
 * 对应数据库表 t_like 和用户表关联
 */
public class LikeMessage {
    private int likeId;
    private int likerId;       // 点赞者ID
    private String likerName;  // 点赞者名称
    private String likerAvatar; // 点赞者头像
    private int contentId;     // 被点赞的内容ID
    private String contentTitle; // 被点赞的内容标题
    private LocalDateTime likeTime; // 点赞时间
    private boolean isRead;    // 是否已读

    @Override
    public String toString() {
        return "LikeMessage{" +
                "likeId=" + likeId +
                ", likerId=" + likerId +
                ", likerName='" + likerName + '\'' +
                ", likerAvatar='" + likerAvatar + '\'' +
                ", contentId=" + contentId +
                ", contentTitle='" + contentTitle + '\'' +
                ", likeTime=" + likeTime +
                ", isRead=" + isRead +
                '}';
    }

    public LikeMessage() {
    }

    public LikeMessage(int likeId, int likerId, String likerName, String likerAvatar, int contentId, String contentTitle, LocalDateTime likeTime, boolean isRead) {
        this.likeId = likeId;
        this.likerId = likerId;
        this.likerName = likerName;
        this.likerAvatar = likerAvatar;
        this.contentId = contentId;
        this.contentTitle = contentTitle;
        this.likeTime = likeTime;
        this.isRead = isRead;
    }

    public int getLikeId() {
        return likeId;
    }

    public void setLikeId(int likeId) {
        this.likeId = likeId;
    }

    public int getLikerId() {
        return likerId;
    }

    public void setLikerId(int likerId) {
        this.likerId = likerId;
    }

    public String getLikerName() {
        return likerName;
    }

    public void setLikerName(String likerName) {
        this.likerName = likerName;
    }

    public String getLikerAvatar() {
        return likerAvatar;
    }

    public void setLikerAvatar(String likerAvatar) {
        this.likerAvatar = likerAvatar;
    }

    public int getContentId() {
        return contentId;
    }

    public void setContentId(int contentId) {
        this.contentId = contentId;
    }

    public String getContentTitle() {
        return contentTitle;
    }

    public void setContentTitle(String contentTitle) {
        this.contentTitle = contentTitle;
    }

    public LocalDateTime getLikeTime() {
        return likeTime;
    }

    public void setLikeTime(LocalDateTime likeTime) {
        this.likeTime = likeTime;
    }
    @JsonProperty("isRead")
    public boolean isRead() {
        return isRead;
    }

    public void setRead(boolean read) {
        isRead = read;
    }
}
